home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 337_01 / listdemo.c < prev    next >
C/C++ Source or Header  |  1991-01-12  |  907b  |  38 lines

  1. /* Copyright (c) James L. Pinson 1990,1991  */
  2.  
  3. /**********************   LISTDEMO.C   ***************************/
  4.  
  5. #include "mydef.h"
  6. #include <stddef.h>
  7.  
  8. int start(void)      /* start is the entry point */
  9. {
  10. extern struct screen_structure scr;
  11. extern struct window_structure w[];
  12.  
  13. char string[30];
  14. int select_win;
  15. int selection;
  16. char *ptr[11]= {
  17.                 "Apple     ", "Boat      ", "Berry     ",
  18.                 "Car       ", "Computer  ", "Denver    ",
  19.                 "Donut     ", "Dog       ", "Elephant  ",
  20.                 "Egg       ", NULL
  21.                 };
  22. cls();
  23.  
  24. select_win= win_make(1,2,10,5,STD_FRAME,"",scr.normal,scr.normal);
  25.  
  26. selection=list_select(ptr);
  27.  
  28. win_delete(select_win);
  29.  
  30.  if (selection==-1) print(1,1,"No selection made");
  31.   else {
  32.     sprintf(string,"Item number %i was selected",selection);
  33.     print(1,1,string);
  34.   }
  35.  
  36. return(0);
  37. }
  38.